<?php if (!defined('BASEPATH')) exit('Sorry, error.. :]');

class Photo extends Controller {

    function __construct()
	{
		parent::Controller();
		
		$this->load->helper('url');
		$this->load->library('frontview');
		$this->load->model(array('PhotoModel', 'CategoryModel'));

		$this->smartylib->debugging = true;
	}

	function index($name, $id)
	{
		$this->smartylib->assign('page', $this->frontview->view());
		$this->smartylib->assign('cat', $this->CategoryModel->getCategory($name, true));
		$this->smartylib->assign('photo', $this->PhotoModel->getPhoto($id, true));
		$this->smartylib->assign('photos', $this->PhotoModel->getPhotoByCategory($name, true));
		$this->smartylib->display('layout.tpl');
	}

}